<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Projet Jetpack:  Fichier source de /home/p1006250/lif7-projet-jetpack/src/Menu.c</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Projet Jetpack
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Généré par Doxygen 1.7.6.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Page&#160;principale</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Fichiers</span></a></li>
      <li><a href="dirs.html"><span>Répertoires</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>Liste&#160;des&#160;fichiers</span></a></li>
      <li><a href="globals.html"><span>Membres&#160;de&#160;fichier</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('_menu_8c.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">Menu.c</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_menu_8c.html">Aller à la documentation de ce fichier.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#include &lt;stdio.h&gt;</span>
<a name="l00002"></a>00002 <span class="preprocessor">#include &lt;stdlib.h&gt;</span>
<a name="l00003"></a>00003 <span class="preprocessor">#include &quot;<a class="code" href="_menu_8h.html">Menu.h</a>&quot;</span>
<a name="l00004"></a>00004 <span class="preprocessor">#include &quot;<a class="code" href="_sdl_jeu_8h.html">SdlJeu.h</a>&quot;</span>
<a name="l00005"></a>00005 <span class="preprocessor">#include &lt;assert.h&gt;</span>
<a name="l00006"></a><a class="code" href="_menu_8h.html#a31cafb2d022c45078a8d1094f6869585">00006</a> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="_menu_8c.html#a31cafb2d022c45078a8d1094f6869585">MENU_MAX</a> = 4;
<a name="l00007"></a>00007 
<a name="l00008"></a><a class="code" href="_menu_8h.html#ac9173284bede8ed68802f18d49ff5de4">00008</a> <span class="keywordtype">void</span> <a class="code" href="_menu_8c.html#ac9173284bede8ed68802f18d49ff5de4" title=" Brief Description  Affiche les Instructions.  ">Instruction</a>(SDL_Surface *ecran, TTF_Font *Mario,TTF_Font *Snorlax,
<a name="l00009"></a>00009                   SDL_Color Noir, SDL_Color Rouge)
<a name="l00010"></a>00010 {
<a name="l00011"></a>00011 
<a name="l00012"></a>00012     SDL_Surface *ligne[7] = {NULL}, *titre = NULL, *caption = NULL;
<a name="l00013"></a>00013     SDL_Rect posLigne[7], posTitre, posCaption;
<a name="l00014"></a>00014     SDL_Event instructions;
<a name="l00015"></a>00015     <span class="keywordtype">long</span> i = 0;
<a name="l00016"></a>00016     <span class="keywordtype">int</span> continuer = 1;
<a name="l00017"></a>00017     titre = TTF_RenderText_Blended(Mario, <span class="stringliteral">&quot;Instructions&quot;</span>, Rouge);
<a name="l00018"></a>00018     posTitre.x = ecran-&gt;w / 2 - titre-&gt;w / 2;
<a name="l00019"></a>00019     posTitre.y = 10;
<a name="l00020"></a>00020     ligne[0] = TTF_RenderText_Blended(Snorlax, <span class="stringliteral">&quot;A l&#39;aide de la fleche directionnelle haut,&quot;</span>, Noir);
<a name="l00021"></a>00021     posLigne[0].x = 35;
<a name="l00022"></a>00022     posLigne[0].y = 140;
<a name="l00023"></a>00023     ligne[1] = TTF_RenderText_Blended(Snorlax, <span class="stringliteral">&quot;deplacer votre personnage afin qu&#39;il evites &quot;</span>, Noir);
<a name="l00024"></a>00024     posLigne[1].x = 35;
<a name="l00025"></a>00025     posLigne[1].y = 170;
<a name="l00026"></a>00026     ligne[2] = TTF_RenderText_Blended(Snorlax, <span class="stringliteral">&quot;les obstacles et aider le a parcourir&quot;</span>, Noir);
<a name="l00027"></a>00027     posLigne[2].x = 35;
<a name="l00028"></a>00028     posLigne[2].y = 200;
<a name="l00029"></a>00029     ligne[3] = TTF_RenderText_Blended(Snorlax, <span class="stringliteral">&quot;la plus longue distance. &quot;</span>, Noir);
<a name="l00030"></a>00030     posLigne[3].x = 35;
<a name="l00031"></a>00031     posLigne[3].y = 230;
<a name="l00032"></a>00032     caption = TTF_RenderText_Blended(Snorlax, <span class="stringliteral">&quot;[R] Retour&quot;</span>, Noir);
<a name="l00033"></a>00033     posCaption.x = 79;
<a name="l00034"></a>00034     posCaption.y = 350;
<a name="l00035"></a>00035     SDL_BlitSurface(titre, NULL, ecran, &amp;posTitre);
<a name="l00036"></a>00036     <span class="keywordflow">for</span>(i=0;i&lt;5;i++)
<a name="l00037"></a>00037     SDL_BlitSurface(ligne[i], NULL, ecran, &amp;posLigne[i]);
<a name="l00038"></a>00038     SDL_BlitSurface(caption, NULL, ecran, &amp;posCaption);
<a name="l00039"></a>00039     SDL_Flip(ecran);
<a name="l00040"></a>00040     <span class="keywordflow">while</span> (continuer)
<a name="l00041"></a>00041     {
<a name="l00042"></a>00042         SDL_WaitEvent(&amp;instructions);
<a name="l00043"></a>00043         <span class="keywordflow">switch</span>(instructions.type)
<a name="l00044"></a>00044         {
<a name="l00045"></a>00045             <span class="keywordflow">case</span> SDL_QUIT:
<a name="l00046"></a>00046             continuer = 0;
<a name="l00047"></a>00047             exit(EXIT_SUCCESS);
<a name="l00048"></a>00048             <span class="keywordflow">break</span>;
<a name="l00049"></a>00049             <span class="keywordflow">case</span> SDL_KEYDOWN:
<a name="l00050"></a>00050             <span class="keywordflow">switch</span>(instructions.key.keysym.sym)
<a name="l00051"></a>00051             {
<a name="l00052"></a>00052                 <span class="keywordflow">case</span> SDLK_r:
<a name="l00053"></a>00053                 <span class="keywordflow">default</span> :
<a name="l00054"></a>00054                 <a class="code" href="main_8c.html#a3c04138a5bfe5d72780bb7e82a18e627">main</a>(1, <span class="stringliteral">&quot;Insctructions&quot;</span>);
<a name="l00055"></a>00055                 <span class="keywordflow">break</span>;
<a name="l00056"></a>00056                 <span class="keywordflow">case</span> SDLK_ESCAPE:
<a name="l00057"></a>00057                 continuer = 0;
<a name="l00058"></a>00058                 exit(EXIT_SUCCESS);
<a name="l00059"></a>00059                 <span class="keywordflow">break</span>;
<a name="l00060"></a>00060              }
<a name="l00061"></a>00061         }
<a name="l00062"></a>00062     }
<a name="l00063"></a>00063     SDL_FreeSurface(titre);
<a name="l00064"></a>00064     <span class="keywordflow">for</span>(i = 0; i &lt; 6; i++)
<a name="l00065"></a>00065     SDL_FreeSurface(ligne[i]);
<a name="l00066"></a>00066 }
<a name="l00067"></a>00067 
<a name="l00068"></a><a class="code" href="_menu_8h.html#a6cd88955ddf199474edca7bc7d6bcc07">00068</a> <span class="keywordtype">void</span> <a class="code" href="_menu_8c.html#a6cd88955ddf199474edca7bc7d6bcc07" title=" Brief Description  Lance le jeu.  ">SDL</a>()
<a name="l00069"></a>00069 {
<a name="l00070"></a>00070     <a class="code" href="structsdl_jeu.html">sdlJeu</a> Sj;
<a name="l00071"></a>00071     <a class="code" href="_sdl_jeu_8c.html#a5e89604c62c942df8c827ac35f936fdf" title=" Brief Description  Initialise le SDL.  ">sdlInit</a>(&amp;Sj);
<a name="l00072"></a>00072         <a class="code" href="_sdl_jeu_8c.html#a97bab0e0a1d30cbaa850699e06dcab92" title=" Brief Description  Fait tourner le jeu sous SDL.  ">sdljeuBoucle</a>(&amp;Sj);
<a name="l00073"></a>00073         <a class="code" href="_sdl_jeu_8c.html#a1d05d7d58fdff72e97f5b8e70b10299d" title=" Brief Description  Libère SDL.  ">sdlLibere</a>(&amp;Sj);
<a name="l00074"></a>00074 }
<a name="l00075"></a>00075 
<a name="l00076"></a><a class="code" href="_menu_8h.html#a3a9aeffc30e95b3d937df7f3b58df759">00076</a> <span class="keywordtype">void</span> <a class="code" href="_menu_8c.html#a3a9aeffc30e95b3d937df7f3b58df759" title=" Brief Description  Affiche les Meilleurs scores.  ">score</a>(SDL_Surface *ecran, TTF_Font *Mario,TTF_Font *Snorlax,
<a name="l00077"></a>00077                   SDL_Color Noir, SDL_Color Rouge)
<a name="l00078"></a>00078 {
<a name="l00079"></a>00079 
<a name="l00080"></a>00080     <span class="keywordtype">int</span> i,j=100,continuer = 1;
<a name="l00081"></a>00081     SDL_Surface *<a class="code" href="_menu_8c.html#a3a9aeffc30e95b3d937df7f3b58df759" title=" Brief Description  Affiche les Meilleurs scores.  ">score</a>,*titre = NULL,*caption = NULL;
<a name="l00082"></a>00082     SDL_Rect  posScore[10],posTitre,posCaption;
<a name="l00083"></a>00083     SDL_Event instructions;
<a name="l00084"></a>00084     <span class="keywordtype">int</span> tabscore[10] = {0};
<a name="l00085"></a>00085     <span class="keywordtype">char</span>  score2[50] = {0} ;
<a name="l00086"></a>00086     FILE * scoreFic;
<a name="l00087"></a>00087     scoreFic = fopen(<span class="stringliteral">&quot;data/Score.txt&quot;</span>, <span class="stringliteral">&quot;r&quot;</span>);
<a name="l00088"></a>00088     <span class="keywordflow">if</span> (scoreFic==NULL)
<a name="l00089"></a>00089     {
<a name="l00090"></a>00090         printf(<span class="stringliteral">&quot;Erreur lors de l&#39;ouverture de %s\n&quot;</span>, <span class="stringliteral">&quot;data/Score.txt&quot;</span>);
<a name="l00091"></a>00091         assert(scoreFic);
<a name="l00092"></a>00092     }
<a name="l00093"></a>00093 
<a name="l00094"></a>00094 
<a name="l00095"></a>00095             titre = TTF_RenderText_Blended(Mario, <span class="stringliteral">&quot;Scores&quot;</span>, Rouge);
<a name="l00096"></a>00096             posTitre.x = ecran-&gt;w / 2 - titre-&gt;w / 2;
<a name="l00097"></a>00097             posTitre.y = 10;
<a name="l00098"></a>00098             fscanf (scoreFic, <span class="stringliteral">&quot;%d&quot;</span> <span class="stringliteral">&quot;%d&quot;</span> <span class="stringliteral">&quot;%d&quot;</span> <span class="stringliteral">&quot;%d&quot;</span> <span class="stringliteral">&quot;%d&quot;</span> <span class="stringliteral">&quot;%d&quot;</span> <span class="stringliteral">&quot;%d&quot;</span> <span class="stringliteral">&quot;%d&quot;</span> <span class="stringliteral">&quot;%d&quot;</span> <span class="stringliteral">&quot;%d&quot;</span> , &amp;tabscore[0],&amp;tabscore[1],&amp;tabscore[2],
<a name="l00099"></a>00099                     &amp;tabscore[3],&amp;tabscore[4],&amp;tabscore[5],&amp;tabscore[6],&amp;tabscore[7],&amp;tabscore[8],&amp;tabscore[9]);
<a name="l00100"></a>00100 
<a name="l00101"></a>00101             caption = TTF_RenderText_Blended(Snorlax, <span class="stringliteral">&quot;[R] Retour&quot;</span>, Noir);
<a name="l00102"></a>00102             posCaption.x = 230;
<a name="l00103"></a>00103             posCaption.y = 430;
<a name="l00104"></a>00104             SDL_BlitSurface(titre, NULL, ecran, &amp;posTitre);
<a name="l00105"></a>00105             SDL_BlitSurface(caption, NULL, ecran, &amp;posCaption);
<a name="l00106"></a>00106 
<a name="l00107"></a>00107             <span class="keywordflow">for</span>(i=0;i&lt;10;i++)
<a name="l00108"></a>00108             {
<a name="l00109"></a>00109                 posScore[i].x = 230;
<a name="l00110"></a>00110                 posScore[i].y= j;
<a name="l00111"></a>00111                 j=j+30;
<a name="l00112"></a>00112             }
<a name="l00113"></a>00113 
<a name="l00114"></a>00114 
<a name="l00115"></a>00115             <span class="keywordflow">for</span>(i=0;i&lt;10;i++)
<a name="l00116"></a>00116             {
<a name="l00117"></a>00117 
<a name="l00118"></a>00118                 sprintf(score2,<span class="stringliteral">&quot;#%d   &quot;</span> <span class="stringliteral">&quot;%d&quot;</span>,i+1,tabscore[9-i]);
<a name="l00119"></a>00119                 score = TTF_RenderText_Blended(Snorlax,score2,Noir);
<a name="l00120"></a>00120 
<a name="l00121"></a>00121                     SDL_BlitSurface(score, NULL,ecran, &amp;posScore[i]);
<a name="l00122"></a>00122 
<a name="l00123"></a>00123 
<a name="l00124"></a>00124                 SDL_Flip(ecran);
<a name="l00125"></a>00125             }
<a name="l00126"></a>00126             <span class="keywordflow">while</span> (continuer)
<a name="l00127"></a>00127             {
<a name="l00128"></a>00128                 SDL_WaitEvent(&amp;instructions);
<a name="l00129"></a>00129                 <span class="keywordflow">switch</span>(instructions.type)
<a name="l00130"></a>00130                 {
<a name="l00131"></a>00131                     <span class="keywordflow">case</span> SDL_QUIT:
<a name="l00132"></a>00132                     continuer = 0;
<a name="l00133"></a>00133                     exit(EXIT_SUCCESS);
<a name="l00134"></a>00134                     <span class="keywordflow">break</span>;
<a name="l00135"></a>00135                     <span class="keywordflow">case</span> SDL_KEYDOWN:
<a name="l00136"></a>00136                     <span class="keywordflow">switch</span>(instructions.key.keysym.sym)
<a name="l00137"></a>00137                     {
<a name="l00138"></a>00138                         <span class="keywordflow">case</span> SDLK_r:
<a name="l00139"></a>00139                         <span class="keywordflow">default</span> :
<a name="l00140"></a>00140                         <a class="code" href="main_8c.html#a3c04138a5bfe5d72780bb7e82a18e627">main</a>(1, <span class="stringliteral">&quot;Scores&quot;</span>);
<a name="l00141"></a>00141                         <span class="keywordflow">break</span>;
<a name="l00142"></a>00142                         <span class="keywordflow">case</span> SDLK_ESCAPE:
<a name="l00143"></a>00143                         continuer = 0;
<a name="l00144"></a>00144                         exit(EXIT_SUCCESS);
<a name="l00145"></a>00145                         <span class="keywordflow">break</span>;
<a name="l00146"></a>00146                      }
<a name="l00147"></a>00147                 }
<a name="l00148"></a>00148             }
<a name="l00149"></a>00149 
<a name="l00150"></a>00150     SDL_FreeSurface(titre);
<a name="l00151"></a>00151     SDL_FreeSurface(score);
<a name="l00152"></a>00152 }
<a name="l00153"></a>00153 
<a name="l00154"></a><a class="code" href="_menu_8h.html#a870bfaef1ea13141e4346ea02cd3e9d1">00154</a> <span class="keywordtype">void</span> <a class="code" href="_menu_8c.html#a870bfaef1ea13141e4346ea02cd3e9d1" title=" Brief Description  Affiche le menu.  ">menuAff</a>(SDL_Surface *ecran, SDL_Surface *fond,TTF_Font *Mario,TTF_Font *Snorlax
<a name="l00155"></a>00155              , SDL_Color Noir, SDL_Color Rouge)
<a name="l00156"></a>00156 {
<a name="l00157"></a>00157     <span class="keywordtype">int</span> i;
<a name="l00158"></a>00158     SDL_Init(SDL_INIT_VIDEO);
<a name="l00159"></a>00159     SDL_Surface *bienvenue = NULL, *select[4] = {NULL};
<a name="l00160"></a>00160     SDL_Rect posBienvenue,   posSelect[4];
<a name="l00161"></a>00161 
<a name="l00162"></a>00162     SDL_Event event;
<a name="l00163"></a>00163     <span class="keywordtype">int</span> continuer = 1;
<a name="l00164"></a>00164 
<a name="l00165"></a>00165     bienvenue = TTF_RenderText_Blended(Mario, <span class="stringliteral">&quot;MarioJetpack&quot;</span>, Rouge);
<a name="l00166"></a>00166     select[0] = TTF_RenderText_Blended(Snorlax, <span class="stringliteral">&quot;[J] Jouer&quot;</span>, Noir);
<a name="l00167"></a>00167     posSelect[0].x = 440;
<a name="l00168"></a>00168     posSelect[0].y = 260;
<a name="l00169"></a>00169     select[1] = TTF_RenderText_Blended(Snorlax, <span class="stringliteral">&quot;[I] Instruction&quot;</span>, Noir);
<a name="l00170"></a>00170     posSelect[1].x = 440;
<a name="l00171"></a>00171     posSelect[1].y = 285;
<a name="l00172"></a>00172     select[2] = TTF_RenderText_Blended(Snorlax, <span class="stringliteral">&quot;[S] Scores&quot;</span>, Noir);
<a name="l00173"></a>00173     posSelect[2].x = 440;
<a name="l00174"></a>00174     posSelect[2].y = 310;
<a name="l00175"></a>00175     select[3] = TTF_RenderText_Blended(Snorlax, <span class="stringliteral">&quot;[ECH] Quitter&quot;</span>, Noir);
<a name="l00176"></a>00176     posSelect[3].x = 440;
<a name="l00177"></a>00177     posSelect[3].y = 335;
<a name="l00178"></a>00178     SDL_Rect posFond;
<a name="l00179"></a>00179     posFond.x = 0;
<a name="l00180"></a>00180     posFond.y = 0;
<a name="l00181"></a>00181 
<a name="l00182"></a>00182     SDL_WM_SetIcon(SDL_LoadBMP(<span class="stringliteral">&quot;icon.bmp&quot;</span>), NULL);
<a name="l00183"></a>00183     ecran = SDL_SetVideoMode(650, 480, 32, SDL_HWSURFACE | SDL_DOUBLEBUF);
<a name="l00184"></a>00184     posBienvenue.x = ecran-&gt;w / 2 - bienvenue-&gt;w/2;
<a name="l00185"></a>00185     posBienvenue.y = 10;
<a name="l00186"></a>00186 
<a name="l00187"></a>00187     SDL_WM_SetCaption(<span class="stringliteral">&quot;Le Jeu JetPack&quot;</span>, NULL);
<a name="l00188"></a>00188     fond = SDL_LoadBMP(<span class="stringliteral">&quot;data/fond.bmp&quot;</span>);
<a name="l00189"></a>00189     SDL_BlitSurface(fond, NULL, ecran, &amp;posFond);
<a name="l00190"></a>00190     SDL_BlitSurface(bienvenue, NULL, ecran, &amp;posBienvenue);
<a name="l00191"></a>00191     <span class="keywordflow">for</span>(i=0; i&lt;4; i++)
<a name="l00192"></a>00192     {
<a name="l00193"></a>00193         SDL_BlitSurface(select[i], NULL, ecran, &amp;posSelect[i]);
<a name="l00194"></a>00194     }
<a name="l00195"></a>00195 
<a name="l00196"></a>00196     SDL_Flip(ecran);
<a name="l00197"></a>00197         SDL_Delay(5);
<a name="l00198"></a>00198 
<a name="l00199"></a>00199     <span class="keywordflow">for</span>(i = 0; i &lt; 4; i++)
<a name="l00200"></a>00200     SDL_FreeSurface(select[i]);
<a name="l00201"></a>00201 
<a name="l00202"></a>00202     <span class="keywordflow">while</span> (continuer)
<a name="l00203"></a>00203     {
<a name="l00204"></a>00204         SDL_WaitEvent(&amp;event);
<a name="l00205"></a>00205         <span class="keywordflow">switch</span>(event.type)
<a name="l00206"></a>00206         {
<a name="l00207"></a>00207         <span class="keywordflow">case</span> SDL_QUIT:
<a name="l00208"></a>00208         continuer = 0;
<a name="l00209"></a>00209         exit(EXIT_SUCCESS);
<a name="l00210"></a>00210         <span class="keywordflow">break</span>;
<a name="l00211"></a>00211         <span class="keywordflow">case</span> SDL_KEYDOWN:
<a name="l00212"></a>00212         <span class="keywordflow">switch</span>(event.key.keysym.sym)
<a name="l00213"></a>00213             {
<a name="l00214"></a>00214             <span class="keywordflow">case</span> SDLK_i:
<a name="l00215"></a>00215             SDL_BlitSurface(fond, NULL, ecran, &amp;posFond);
<a name="l00216"></a>00216             <a class="code" href="_menu_8c.html#ac9173284bede8ed68802f18d49ff5de4" title=" Brief Description  Affiche les Instructions.  ">Instruction</a>(ecran,Mario,Snorlax,Noir,Rouge);
<a name="l00217"></a>00217             <span class="keywordflow">default</span> :
<a name="l00218"></a>00218             <span class="keywordflow">break</span>;
<a name="l00219"></a>00219             <span class="keywordflow">case</span> SDLK_j:
<a name="l00220"></a>00220             <a class="code" href="_menu_8c.html#a6cd88955ddf199474edca7bc7d6bcc07" title=" Brief Description  Lance le jeu.  ">SDL</a>();
<a name="l00221"></a>00221             <span class="keywordflow">break</span>;
<a name="l00222"></a>00222             <span class="keywordflow">case</span> SDLK_s:
<a name="l00223"></a>00223             SDL_BlitSurface(fond, NULL, ecran, &amp;posFond);
<a name="l00224"></a>00224             <a class="code" href="_menu_8c.html#a3a9aeffc30e95b3d937df7f3b58df759" title=" Brief Description  Affiche les Meilleurs scores.  ">score</a>(ecran,Mario,Snorlax,Noir,Rouge);
<a name="l00225"></a>00225             <span class="keywordflow">break</span>;
<a name="l00226"></a>00226             <span class="keywordflow">case</span> SDLK_ESCAPE:
<a name="l00227"></a>00227             continuer = 0;
<a name="l00228"></a>00228             exit(EXIT_SUCCESS);
<a name="l00229"></a>00229             <span class="keywordflow">break</span>;
<a name="l00230"></a>00230             }
<a name="l00231"></a>00231         }
<a name="l00232"></a>00232     }
<a name="l00233"></a>00233         SDL_FreeSurface(fond);
<a name="l00234"></a>00234         SDL_FreeSurface(bienvenue);
<a name="l00235"></a>00235 
<a name="l00236"></a>00236 }
<a name="l00237"></a>00237 
<a name="l00238"></a><a class="code" href="_menu_8h.html#acb282ec339250edc43e58f6a064d94ab">00238</a> <a class="code" href="_menu_8h.html#a81ef2f4a6c4e4f626cdff90adc5ffbb0">ChoixMenu</a> <a class="code" href="_menu_8c.html#acb282ec339250edc43e58f6a064d94ab" title=" Brief Description  Affiche le choix du joueur.  ">menuQuestion</a>()
<a name="l00239"></a>00239 {
<a name="l00240"></a>00240         <a class="code" href="_menu_8h.html#a81ef2f4a6c4e4f626cdff90adc5ffbb0">ChoixMenu</a> cm;
<a name="l00241"></a>00241         <span class="keywordtype">int</span> i;
<a name="l00242"></a>00242         <span class="keywordtype">char</span> dum[32];
<a name="l00243"></a>00243         <span class="keywordtype">int</span> ok=0;
<a name="l00244"></a>00244         <span class="keywordflow">do</span>
<a name="l00245"></a>00245         {
<a name="l00246"></a>00246                 <span class="keywordflow">if</span> (scanf(<span class="stringliteral">&quot;%d&quot;</span>,&amp;i)!=1) scanf(<span class="stringliteral">&quot;%s&quot;</span>,dum);
<a name="l00247"></a>00247                 cm=((<a class="code" href="_menu_8h.html#a81ef2f4a6c4e4f626cdff90adc5ffbb0">ChoixMenu</a>)(i));
<a name="l00248"></a>00248                 <span class="keywordflow">if</span> ((cm&lt;0) || (cm&gt;=<a class="code" href="_menu_8c.html#a31cafb2d022c45078a8d1094f6869585">MENU_MAX</a>))
<a name="l00249"></a>00249                         printf(<span class="stringliteral">&quot;Erreur choix menu\n&quot;</span>);
<a name="l00250"></a>00250                 <span class="keywordflow">else</span> ok=1;
<a name="l00251"></a>00251                 fflush(stdout);
<a name="l00252"></a>00252         } <span class="keywordflow">while</span>(ok==0);
<a name="l00253"></a>00253         printf(<span class="stringliteral">&quot;\n&quot;</span>); fflush(stdout);
<a name="l00254"></a>00254         <span class="keywordflow">return</span> cm;
<a name="l00255"></a>00255 
<a name="l00256"></a>00256 
<a name="l00257"></a>00257 
<a name="l00258"></a>00258 }
<a name="l00259"></a>00259 
</pre></div></div><!-- contents -->
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="_menu_8c.html">Menu.c</a>      </li>

    <li class="footer">Généré le Lundi Décembre 17 2012 01:09:40 pour Projet Jetpack par
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.6.1 </li>
   </ul>
 </div>


</body>
</html>
